<template>
  <div id="informmanage">
    <el-card class="box-card" style="margin:15px">
      <el-form
        ref="basicForm"
        :rules="basicDataRules"
        :inline="true"
        :model="basicData.model"
        class="demo-form-inline"
        size="small"
        label-width="150px"
      >
        <el-row>
          <el-col :span="6">
            <el-form-item label="所属区县:" prop="areaId.key" width="300px">
              <el-select
                size="mini"
                v-model="basicData.model.areaId.key"
                placeholder="选择"
                @change="clickOrgTree"
              >
                <el-option
                  v-for="(item, index) in orgTree"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                  width="300px"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="所属医院:" prop="hospitalId.key">
              <el-select
                size="mini"
                v-model="basicData.model.hospitalId.key"
                placeholder="选择"
                @change="clickOrgTreeC"
              >
                <el-option
                  v-for="(item, index) in orgTreeC"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="所属部门:" prop="departId.key">
              <el-select size="mini" v-model="basicData.model.departId.key" placeholder="选择">
                <el-option
                  v-for="(item, index) in orgTreeCs"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="6">
            <el-form-item label="母亲姓名:" prop="momName">
              <el-input size="mini" v-model="basicData.model.momName" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="母亲身份证:" prop="momCard">
              <el-input size="mini" v-model="basicData.model.momCard" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="手机号码:" prop="phone">
              <el-input size="mini" v-model="basicData.model.phone" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="通知类型:" prop="notiType">
              <el-select size="mini" v-model="basicData.model.notiType" placeholder="请选择">
                <el-option
                  v-for="(item, key, index) in dicts.INFORM_WAY"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="通知状态:" prop="informStatus.key">
              <el-select size="mini" v-model="basicData.model.informStatus.key" placeholder="请选择">
                <!-- <el-option
                  v-for="(item, key, index) in dicts.NOTIFY_STATUS"
                  :key="index"
                  :label="item"
                  :value="key"
                />-->
                <el-option label="已通知" value="Y" />
                <el-option label="未通知" value="N" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="召回状态:" prop="recallStatus.key">
              <el-select size="mini" v-model="basicData.model.recallStatus.key" placeholder="请选择">
                <!-- <el-option
                  v-for="(item, key, index) in dicts.RECALL_STATUS"
                  :key="index"
                  :label="item"
                  :value="key"
                />-->
                <el-option label="已召回" value="Y" />
                <el-option label="未召回" value="N" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="归档状态:" prop="fileStatus.key">
              <el-select size="mini" v-model="basicData.model.fileStatus.key" placeholder="请选择">
                <el-option
                  v-for="(item, key, index) in dicts.FILE_STATUS"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12" class="time-list">
            <div class="select-input" style="padding-left:2.3vw">
              <el-select
                size="mini"
                style="width:120px !important;"
                slot="prepend"
                v-model="timeType"
                placeholder="报告日期"
              >
                <el-option
                  v-for="(item, key, index) in dicts.TIME"
                  :key="item"
                  :label="item"
                  :value="key"
                />
              </el-select>
              <el-date-picker
                size="mini"
                v-model="timeList"
                type="daterange"
                value-format="yyyy-MM-dd"
                style="width:500px"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              />
            </div>
          </el-col>
          <el-col :span="24">
            <el-form-item label="实验项目-管理:" prop="experimentProject" class="experimentList">
              <el-checkbox-group v-model="basicData.model.experimentProject">
                <el-checkbox
                  v-for="(item, key, index) in dicts.EXPERIMENT_CODE"
                  :label="key"
                  name="type"
                >{{ item }}</el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div class="buttom">
        <el-button
          type="primary"
          size="mini"
          style="width:100px"
          icon="el-icon-search"
          @click="onSubmit('query')"
        >查询</el-button>
        <el-button size="mini" @click="onSubmit('reset')">清空</el-button>
      </div>
    </el-card>
    <el-card class="box-card" style="margin:5px 15px;">
      <el-table
        v-loading="loading"
        :data="tableData"
        style="width: 100%;padding:5px;"
        :header-cell-style="{
          background: '#333333',
          color: '#ffffff',
          textAlign: 'center'
        }"
      >
        <el-table-column align="center" prop="hospitalName" width="150" label="所属医院" />
        <el-table-column align="center" prop="momName" label="母亲姓名" />
        <el-table-column align="center" prop="babySex.data" label="性别" />
        <el-table-column align="center" prop="birthTime" width="125" label="出生日期">
          <template slot-scope="scope">
            <span>{{ scope.row.birthTime?scope.row.birthTime.substr(0, 10):'' }}</span>
          </template>
        </el-table-column>
        <el-table-column align="center" prop="experimentKeywords.data" label="实验项目" />
        <el-table-column align="center" prop="phone" width="125" label="手机号码" />
        <el-table-column
          align="center"
          prop="disqualificationReason.data"
          width="125"
          label="不合格原因"
        />
        <el-table-column align="center" prop="recallStatus.desc" label="召回状态" />
        <el-table-column align="center" prop="informStatus.desc" label="通知状态" />
        <el-table-column align="center" prop="fileStatus.data" label="归档状态" />
        <el-table-column align="center" prop="newBarcode" width="125" label="新条码" />
        <el-table-column align="center" prop="expNum" width="125" label="实验编号" />
        <el-table-column align="center" prop="experimentDate" label="实验日期">
          <template slot-scope="scope">
            <span>
              {{
              scope.row.experimentDate
              ? scope.row.experimentDate.substr(0, 10)
              : ""
              }}
            </span>
          </template>
        </el-table-column>
        <el-table-column align="center" label="操作">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="primary"
              style="background:#2669F3"
              @click="clickInform(scope.row)"
            >通知</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        :current-page="basicData.current"
        :page-size="basicData.size"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      >
        <!-- <span style="font-weight: 400;color:#606266">已选中{{ selectTables.length }}条，</span> -->
      </el-pagination>
    </el-card>

    <!-- 通知弹窗 -->
    <el-dialog :visible.sync="informShow" width="85%" center title="通知" custom-class="print-dialog">
      <el-form
        ref="informForm"
        :inline="true"
        :model="informData"
        class="demo-form-inline"
        size="small"
        label-width="120px"
      >
        <el-row>
          <el-col :span="8">
            <el-form-item label="所属医院:" width="300px">
              <span>
                {{
                informData.sampleBlood
                ? informData.sampleBlood.hospitalName
                : ""
                }}
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="母亲姓名:" width="300px">
              <span>
                {{
                informData.sampleBlood ? informData.sampleBlood.momName : ""
                }}
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="手机号码:" width="300px">
              <span>
                {{
                informData.sampleBlood ? informData.sampleBlood.phone : ""
                }}
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="出生日期:" width="300px">
              <span>
                {{
                informData.sampleBlood ? informData.sampleBlood.birthTime : ""
                }}
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="住院号:" width="300px">
              <span></span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="床位号:" width="300px">
              <span></span>
            </el-form-item>
          </el-col>
        </el-row>

        <el-table
          :data="informData.experimentSamples"
          style="width: 100%;padding:5px;"
          :header-cell-style="{
            background: '#333333',
            color: '#ffffff',
            textAlign: 'center'
          }"
        >
          <el-table-column align="center" type="index" width="55" />
          <el-table-column align="center" prop="barCode" label="条形码号" width="150" />
          <el-table-column align="center" prop="expNum" label="实验编号" width="150" />
          <el-table-column align="center" prop="experimentCode.data" label="实验项目" />
          <el-table-column align="center" prop="flowStatus.data" label="流程状态" />
          <el-table-column align="center" prop="experimentResultTime" label="实验日期" width="150">
            <template slot-scope="scope">
              <span>
                {{
                scope.row.experimentResultTime
                ? scope.row.experimentResultTime.substr(0, 10)
                : ""
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="experimentValue" label="值" />
          <el-table-column align="center" prop="experimentResult.data" label="结论" />
          <el-table-column align="center" prop="doctorAdvice" label="医嘱" show-overflow-tooltip />
        </el-table>

        <el-form-item label="待通知项目:" style="margin-bottom:5px">
          <el-checkbox-group v-model="informData.experimentProject">
            <el-checkbox
              name="type"
              v-for="(item, key, index) in informData.experimentProject"
              :key="index"
              :label="item"
            >{{ item.data }}</el-checkbox>
          </el-checkbox-group>
        </el-form-item>
        <el-row>
          <el-col :span="8">
            <el-form-item label="通知方式:" label-width="88px">
              <el-radio-group v-model="informData.sampleBlood.informWay.key">
                <el-radio
                  v-for="(item, key, index) in dicts.INFORM_WAY"
                  :key="index"
                  :label="key"
                >{{ item }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="8" style="margin-bottom:5px">
            <el-form-item label="被告知人:">
              <el-radio-group v-model="informData.sampleBlood.informGet.key">
                <el-radio
                  v-for="(item, key, index) in dicts.INFORM_GET"
                  :key="index"
                  :label="key"
                >{{ item }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="通知日期:">
              <el-date-picker
                size="mini"
                v-model="informData.sampleBlood.informTime"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
              />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="通知人:">
              <el-input
                size="mini"
                disabled
                v-model="informData.sampleBlood.informMan"
                placeholder="输入"
              />
            </el-form-item>
          </el-col>

          <el-col :span="24" style="margin-bottom:5px">
            <el-form-item label="通知内容:" class="inform-print" label-width="80px">
              <el-input
                size="mini"
                type="textarea"
                style="100%"
                v-model="informData.sampleBlood.informContent"
                placeholder="输入"
              />
            </el-form-item>
          </el-col>
          <el-col :span="24" style="margin-bottom:5px">
            <el-form-item label="通知备注:" class="inform-print" label-width="80px">
              <el-input
                size="mini"
                style="100%"
                v-model="informData.sampleBlood.informDesc"
                placeholder="输入"
              />
            </el-form-item>
          </el-col>
          <el-col :span="24" style="margin-bottom:5px">
            <el-form-item label="归档:" label-width="80px">
              <el-select
                size="mini"
                v-model="informData.sampleBlood.fileStatus.key"
                placeholder="归档"
              >
                <el-option
                  v-for="(item, key, index) in dicts.FILE_STATUS"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-table
          :data="informData.messageList"
          style="width: 100%;padding:5px;"
          :header-cell-style="{
            background: '#333333',
            color: '#ffffff',
            textAlign: 'center'
          }"
        >
          <el-table-column align="center" type="index" width="55" />
          <el-table-column align="center" prop="informMan" label="通知人" />
          <el-table-column align="center" prop="informWay.data" label="通知方式" />
          <el-table-column align="center" prop="informTime" label="通知日期" width="100">
            <template slot-scope="scope">
              <span>
                {{
                scope.row.informTime ? scope.row.informTime.substr(0, 10) : ""
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="informGet.data" label="被告知人" />
          <el-table-column align="center" prop="informContent" label="内容" />
          <el-table-column align="center" prop="informDesc" label="备注" />
          <el-table-column align="center" prop="createTime" label="创建时间">
            <template slot-scope="scope">
              <span>
                {{
                scope.row.createTime ? scope.row.createTime.substr(0, 10) : ""
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="experimentValue" label="值" />
          <el-table-column align="center" prop="experimentResult.data" label="结论" />
          <el-table-column align="center" prop="doctorAdvice" label="医嘱" show-overflow-tooltip />
        </el-table>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button
          size="small"
          type="primary"
          style="padding: 6px 19px;"
          @click="onSubmit('infoSave')"
        >保存</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { initDicts } from "@/utils/commons";
import orgApi from "@/api/Org.js";
import InformManageApi from "@/api/InformManage.js";

export default {
  data() {
    return {
      // 转菊花
      loading: true,
      // 通知弹窗
      informShow: false,
      // 表格数据
      tableData: [],
      // 选中数据
      selectTables: [],
      // 总数
      total: 0,
      // 基本数据
      basicData: {
        current: 1,
        map: {},
        model: {
          areaId: {
            key: ""
          },
          birthTime: {
            end: "",
            start: ""
          },
          departId: {
            key: ""
          },
          experimentKeywords: "",
          experimentProject: [],
          experimentReportTime: {
            end: "",
            start: ""
          },
          experimentResult: {
            data: "",
            key: ""
          },
          experimentResultTime: {
            end: "",
            start: ""
          },
          fileStatus: {
            data: "",
            key: ""
          },
          hospitalId: {
            key: ""
          },
          hospitalName: "",
          informStatus: {
            data: "",
            key: ""
          },
          momCard: "",
          momName: "",
          phone: "",
          recallStatus: {
            data: "",
            key: ""
          },
          recallTime: {
            end: "",
            start: ""
          }
        },
        order: "descending",
        size: 10,
        sort: "id"
      },
      // 校验
      basicDataRules: {
        "areaId.key": [
          { required: true, message: "请选择所属区县", trigger: "change" }
        ],
        "hospitalId.key": [
          { required: true, message: "请选择所属医院", trigger: "change" }
        ],
        "departId.key": [
          { required: true, message: "请选择所属部门", trigger: "change" }
        ],
        momName: [
          { required: false, message: "请输入母亲姓名", trigger: "change" }
        ],
        phone: [
          { required: false, message: "请输入手机号码", trigger: "change" }
        ],
        weight: [{ required: false, message: "请输入体重", trigger: "change" }],
        week: [{ required: false, message: "请输入孕周", trigger: "change" }],
        day: [{ required: false, message: "请输入孕天", trigger: "change" }],
        sex: [{ required: false, message: "请选择性别", trigger: "change" }],
        samplingNumber: [
          { required: false, message: "请输入采血编号", trigger: "change" }
        ],
        barCode: [
          { required: false, message: "请输入条形码号", trigger: "change" }
        ]
      },
      // 字典
      dicts: {
        BLOOD_STATUS: {}, //采样状态
        PAY_WAY: {}, //交付方式
        FILE_STATUS: {}, //归档状态
        INFORM_GET: {}, //被告之人
        COST_TYPE: {}, //费用类型
        MOM_CENSUS: {}, //母亲户籍
        SAMPLE_QUALITY: {}, //样本质量
        EXPERIMENT_CODE: {}, //实验项目
        ACCOUNT_TYPE: {}, //户口类型
        REFUND_AUDIT: {}, //退款审核
        TIME: {}, //时间
        NOTIFY_STATUS: {}, //通知状态
        INFORM_WAY: {}, //通知类型
        RECALL_STATUS: {}, //召回状态
        BABY_SEX: {} //性别
      },
      // 市县
      orgTree: [],
      // 医院
      orgTreeC: [],
      // 部门
      orgTreeCs: [],
      timeType: "",
      timeList: "",
      // 通知数据
      informData: {
        experimentProject: [],
        experimentSamples: [],
        messageList: [],
        sampleBlood: {
          fileStatus: {
            key: "undocumented"
          },
          informGet: {
            key: "mom"
          },
          informWay: {
            key: "phone"
          }
        }
      }
    };
  },
  mounted() {
    initDicts(
      [
        "BLOOD_STATUS",
        "PAY_WAY",
        "FILE_STATUS",
        "INFORM_GET",
        "COST_TYPE",
        "MOM_CENSUS",
        "SAMPLE_QUALITY",
        "EXPERIMENT_CODE",
        "ACCOUNT_TYPE",
        "REFUND_AUDIT",
        "NOTIFY_STATUS",
        "INFORM_WAY",
        "RECALL_STATUS",
        "TIME",
        "BABY_SEX"
      ],
      this.dicts
    );
    // 获取基础查询
    this.initOrgTree();
    // 获取表格数据
    this.getList(this.basicData);
  },
  methods: {
    // 点击通知
    clickInform(v) {
      console.log(v);

      InformManageApi.informManage.informList({ sampleId: v.id }).then(res => {
        if (res.status == 200) {
          this.informData = res.data.data;
          this.informData.sampleBlood = {
            informTime:
              new Date().getFullYear().toString() +
              "-" +
              ((new Date().getMonth() + 1).toString() < 10
                ? "0" + (new Date().getMonth() + 1).toString()
                : (new Date().getMonth() + 1).toString()) +
              "-" +
              (new Date().getDate().toString() < 10
                ? "0" + new Date().getDate().toString()
                : new Date().getDate().toString()),
            fileStatus: {
              key: "undocumented"
            },
            informGet: {
              key: "mom"
            },
            informWay: {
              key: "phone"
            },
            ...res.data.data.sampleBlood,
            informMan: this.$store.state.account.user.name
          };
          this.informShow = true;
        } else {
          this.$message.error(res.statusText);
        }
      });
    },
    // 获取table
    getList(data) {
      this.loading = true;
      InformManageApi.informManage.page(data).then(res => {
        this.tableData = res.data.data.records;
        this.total = res.data.data.total;
        this.loading = false;
      });
    },
    // 根据选择市县获取医院
    clickOrgTree(v) {
      this.orgTreeC = [];
      this.orgTreeCs = [];
      this.basicData.model.hospitalId.key = "";
      this.basicData.model.departId.key = "";
      this.orgTree.filter(res => {
        if (res.id == v) {
          this.orgTreeC = res.children;
        }
      });
    },
    // 根据选择市县获取医院
    clickOrgTreeC(v) {
      this.orgTreeCs = [];
      this.basicData.model.departId.key = "";
      this.orgTreeC.filter(res => {
        if (res.id == v) {
          this.orgTreeCs = res.children;
        }
      });
    },
    // 获取基础查询
    initOrgTree() {
      orgApi.allTree({}).then(response => {
        const res = response.data;
        this.orgTree = res.data[0].children;
      });
    },
    //点击全选
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    // 基础信息按钮点击事件
    onSubmit(type) {
      if (type == "query") {
        switch (this.timeType) {
          // 报告日期
          case "reporttime":
          case "":
            this.basicData.model.reportTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.birthTime = {
              start: "",
              end: ""
            };
            this.basicData.model.bloodTime = {
              start: "",
              end: ""
            };
            this.basicData.model.createTime = {
              start: "",
              end: ""
            };
            this.basicData.model.experimentTime = {
              start: "",
              end: ""
            };
            break;
          // 采血日期
          case "bloodtime":
            this.basicData.model.bloodTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.birthTime = {
              start: "",
              end: ""
            };
            this.basicData.model.createTime = {
              start: "",
              end: ""
            };
            this.basicData.model.experimentTime = {
              start: "",
              end: ""
            };
            this.basicData.model.reportTime = {
              start: "",
              end: ""
            };
            break;
          // 登记日期
          case "createtime":
            this.basicData.model.createTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.birthTime = {
              start: "",
              end: ""
            };
            this.basicData.model.bloodTime = {
              start: "",
              end: ""
            };
            this.basicData.model.experimentTime = {
              start: "",
              end: ""
            };
            this.basicData.model.reportTime = {
              start: "",
              end: ""
            };
            break;
          // 实验日期
          case "experimenttime":
            this.basicData.model.experimentTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.birthTime = {
              start: "",
              end: ""
            };
            this.basicData.model.bloodTime = {
              start: "",
              end: ""
            };
            this.basicData.model.createTime = {
              start: "",
              end: ""
            };
            this.basicData.model.reportTime = {
              start: "",
              end: ""
            };
            break;
          // 出生日期
          case "birthtime":
            this.basicData.model.birthTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.bloodTime = {
              start: "",
              end: ""
            };
            this.basicData.model.createTime = {
              start: "",
              end: ""
            };
            this.basicData.model.experimentTime = {
              start: "",
              end: ""
            };
            this.basicData.model.reportTime = {
              start: "",
              end: ""
            };
            break;
        }
        this.getList(this.basicData);
      } else if (type == "reset") {
        this.$refs["basicForm"].resetFields();
        this.basicData.model = {
          areaId: {
            key: ""
          },
          birthTime: {
            end: "",
            start: ""
          },
          departId: {
            key: ""
          },
          experimentKeywords: "",
          experimentProject: [],
          experimentReportTime: {
            end: "",
            start: ""
          },
          experimentResult: {
            data: "",
            key: ""
          },
          experimentResultTime: {
            end: "",
            start: ""
          },
          fileStatus: {
            data: "",
            key: ""
          },
          hospitalId: {
            key: ""
          },
          hospitalName: "",
          informStatus: {
            data: "",
            key: ""
          },
          momCard: "",
          momName: "",
          phone: "",
          recallStatus: {
            data: "",
            key: ""
          },
          recallTime: {
            end: "",
            start: ""
          }
        };
        this.getList(this.basicData);
      } else if (type == "infoSave") {
        let data = {
          experimentCode: this.informData.experimentProject,
          fileStatus: this.informData.sampleBlood.fileStatus,
          informContent: this.informData.sampleBlood.informContent,
          informDesc: this.informData.sampleBlood.informDesc,
          informGet: this.informData.sampleBlood.informGet,
          informWay: this.informData.sampleBlood.informWay,
          informMan: this.$store.state.account.user.name,
          informTime: this.informData.sampleBlood.informTime,
          sampleId: this.informData.sampleBlood.id
        };
        InformManageApi.informManage
          .informSave(data)
          .then(res => {
            if (res.status == 200) {
              this.$message({
                message: res.statusText,
                type: "success"
              });
              this.getList(this.basicData);
            } else {
              this.$message.error(res.statusText);
            }
          })
          .finally(() => (this.informShow = false));
      }
    },
    // 点击打印
    clickTruePrint() {
      this.handlePrintPrint();
    },
    // 打印事件
    handlePrintPrint() {
      if (this.upLoading) {
        this.$message({
          message: "数据加载中,请稍后...",
          type: "warning"
        });
      } else {
        this.CreateTablePage("print", "采血卡打印", "sampleManage");
      }
    },
    // 点击分页
    handleSizeChange: function(val) {
      this.basicData.size = val;
      this.getList(this.basicData);
    },
    // 选择页码
    handleCurrentChange: function(currentPage) {
      this.basicData.current = currentPage;
      this.getList(this.basicData);
    }
  }
};
</script>

<style lang="less">
.flex {
  display: flex;
  align-items: center;
  justify-content: center;
}
#informmanage {
  .el-form-item__content,
  .el-date-editor,
  .el-select,
  .el-textarea {
    width: 100% !important;
  }
  .el-table__body-wrapper {
    max-height: 250px;
    overflow-y: auto;
  }
  .inform-print {
    .el-form-item__content {
      width: 90%;
    }
  }
  .resample-form {
    .el-form-item__content {
      width: 100%;
    }
    .el-input {
      width: 100%;
    }
    .el-select {
      width: 100%;
    }
  }
  .sun-table {
    .el-table__body-wrapper {
      max-height: 300px;
      overflow-y: auto;
    }
  }
  .mores {
    .flex;
    justify-content: flex-start;
    width: 100%;
    background: #188ff233;
    height: 30px;
    padding: 5px 8px;
    .more-title {
      font-family: SourceHanSansSC;
      font-style: normal;
      letter-spacing: 0px;
      line-height: 20px;
      text-decoration: none;
      margin-right: 1rem;
      font-size: 14px;
      font-weight: 500;
      color: #000;
    }
  }

  #more-row {
    #shiyan {
      .projectIdList {
        width: 100%;
        .el-form-item__content {
          width: 80%;
        }
      }
    }
    .more-col {
      .remark {
        width: 100%;
        .el-form-item__content {
          width: 90%;
        }
      }
    }
    .el-form-item {
      .el-form-item__content {
        width: 400px;
      }
    }
  }
  .buttom {
    width: 100%;
    .flex;
  }
  .el-dialog__header {
    border-bottom: 1px solid #e0e0e0;
  }
  .print-form {
    max-height: 500px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    flex-flow: wrap;
    .print-item {
      width: 50%;
      .flex;
      justify-content: flex-start;
      color: #222222;
      font-size: 15px;
      margin-top: 10px;
      .title {
        font-weight: bold;
        flex: 0.4;
      }
      .value {
        flex: 0.6;
        font-weight: bold;
        overflow-wrap: anywhere;
      }
    }
  }
  .el-dialog__footer {
    .flex;
  }
  .select-input {
    .el-form-item {
      margin: 0;
      .el-select .el-input {
        width: 100%;
      }
    }
    .flex;
    justify-content: flex-start;
    .el-select .el-input {
      width: 110px;
    }
    .input-with-select .el-input-group__prepend {
      background-color: #fff;
    }
  }
}

// .flex {
//   display: flex;
//   align-items: center;
//   justify-content: center;
// }
// #informmanage {
//   .experimentList {
//     .el-form-item__content {
//       width: 80%;
//     }
//   }
//   .mores {
//     .flex;
//     justify-content: flex-start;
//     .more-title {
//       font-size: 12px;
//       font-family: SourceHanSansSC;
//       font-weight: 400;
//       color: rgb(153, 153, 153);
//       font-style: normal;
//       letter-spacing: 0px;
//       line-height: 20px;
//       text-decoration: none;
//       margin-right: 1rem;
//     }
//   }
//   #more-row {
//     #shiyan {
//       .projectIdList {
//         width: 100%;
//         .el-form-item__content {
//           width: 80%;
//         }
//       }
//     }
//     .more-col {
//       .remark {
//         width: 100%;
//         .el-form-item__content {
//           width: 90%;
//         }
//       }
//     }
//     .el-form-item {
//       .el-form-item__content {
//         width: 400px;
//       }
//     }
//   }
//   .buttom {
//     width: 100%;
//     .flex;
//   }
//   .el-dialog__header {
//     border-bottom: 1px solid #e0e0e0;
//   }
//   .print-form {
//     max-height: 500px;
//     overflow: auto;
//     display: flex;
//     flex-direction: column;
//     flex-flow: wrap;
//     .print-item {
//       width: 50%;
//       .flex;
//       justify-content: flex-start;
//       color: #222222;
//       font-size: 15px;
//       margin-top: 10px;
//       .title {
//         font-weight: bold;
//         flex: 0.4;
//       }
//       .value {
//         flex: 0.6;
//         font-weight: bold;
//         overflow-wrap: anywhere;
//       }
//     }
//   }
//   .el-dialog__footer {
//     .flex;
//   }
//   .select-input {
//     .el-form-item {
//       margin: 0;
//       .el-select .el-input {
//         width: 100%;
//       }
//     }
//     .flex;
//     justify-content: flex-start;
//     margin-bottom: 18px;
//     .el-select .el-input {
//       width: 110px;
//     }
//     .input-with-select .el-input-group__prepend {
//       background-color: #fff;
//     }
//   }
// }
//
</style>
